﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="PropertyList.aspx.cs" Inherits="Medianamik.UI.TypeManagement.PropertyList" MasterPageFile="../MasterPages/MedianamikModule.Master" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
	<a href="<%= AddURL %>" class="Action BtAjouter"><%=Resources("Medianamik_TypeManagement", "AddProperty") %></a>
	<a href="<%= ReturnURL %>" class="Action BtAnnuler"><%=Resources("Medianamik_Global", "Cancel") %></a>
&nbsp;
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">

	<med:breadcrumbtrail ID="bctFilAriane" runat="server" CssClass="FilAriane" 
        CurrentPageAsLink="true" Url="TypeList.aspx" ParamName="basetypeid" 
        Separator="" />
	
	<telerik:radgrid runat="server" ID="grdProps" EnableEmbeddedSkins="false" 
        Skin="Medianamik" AllowPaging="false" AutoGenerateColumns="false" 
        OnItemCommand="grdProps_ItemCommand" OnNeedDataSource="grdProps_NeedDataSource" 
        OnItemDataBound="grdProps_ItemDataBound" OnRowDrop="grdProps_RowDrop" 
        AllowMultiRowSelection="false" Width="100%">
		<MasterTableView DataKeyNames="ID">
			<Columns>
				<telerik:GridTemplateColumn>
					<ItemStyle CssClass="DragCursor" />
					<HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, PropNameColTitle %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate>
					    <%# (bool)Eval("IsRequired") ? @"<img src=""/Medianamik/images/Icones/Ico_ProprieteObligatoire.png"" class=""IconeLabel"" alt="""" />&nbsp;&nbsp" : String.Empty %>
					    <%# Eval("Name") %>
					    <%# (bool)Eval("IsLanguageNeutral") ? @"&nbsp;&nbsp;<img src=""/Medianamik/images/Icones/Ico_ProprieteNeutreLangue.png"" class=""IconeLabel"" alt="""" />" : String.Empty %>
					</ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn>
					<ItemStyle CssClass="DragCursor" />
				    <HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, GroupName %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate><%# GetGlobalResourceObject("Medianamik_Tabs", Eval("GroupName").ToString()).ToString()  %> (<%#Eval("GroupName") %>)</ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn>
					<ItemStyle CssClass="DragCursor" />
				    <HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, PropertyOwner %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate><asp:HyperLink runat="server" NavigateUrl='<%# "/medianamik/typemanagement/propertylist.aspx?" + Medianamik.Core.DefaultParamNames.TypeID + "=" + (Container.DataItem as Medianamik.Core.NodeTypeProperty).NodeType.ID %>' Text='<%# (Container.DataItem as Medianamik.Core.NodeTypeProperty).NodeType.Name %>' /></ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn>
					<ItemStyle CssClass="DragCursor" />
				    <HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, PropertyControl %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate><%# (Container.DataItem as Medianamik.Core.NodeTypeProperty).MedianamikControl == null ? "" : (Container.DataItem as Medianamik.Core.NodeTypeProperty).MedianamikControl.Name%></ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn>
					<ItemStyle CssClass="DragCursor" />
				    <HeaderTemplate><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, LookupColTitle %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate><%# GetLookupInfo(Container.DataItem as Medianamik.Core.NodeTypeProperty) %></ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn HeaderStyle-Width="1%" HeaderText="Actions">
					<HeaderStyle HorizontalAlign="Center" />
					<ItemStyle CssClass="Actions" />
					<ItemTemplate>
						<table border="0" cellpadding="0" cellspacing="0" align="center">
							<tr>
							    <td><med:NodeActivationButton ID="PropertyVisibleButton" runat="server"  IsActive='<%# IsVisible((Guid)Eval("ID")) %>'
                                        DisabledImageUrl="/medianamik/images/Icones/Ico_ActifInactif.gif" 
                                        OnCommand="OnPropertyVisibleStatusChanged" CommandArgument='<%#Eval("ID") %>'
                                        NodeId='<%# Eval("ID") %>' SecurityLevel="None" /></td>
                                <td><med:EditLink runat="server" LockEnabled="false" ID="btnEditProperty" 
								    NavigateUrl='<%# "propertymanagement.aspx?propertyid=" + Eval("ID") %>'></med:EditLink></td>
								<td><med:ConfirmedDeleteButton ID="btnDeleteProperty" runat="server" 
								    CommandArgument='<%# Eval("ID") %>' CommandName="DeleteProperty" 
								    ConfirmText="<%$ Resources: Medianamik_TypeManagement, ConfirmDelePropertyText %>" /></td>
							</tr>
						</table>
					</ItemTemplate>
				</telerik:GridTemplateColumn>				
			</Columns> 
			<NoRecordsTemplate>
			    <asp:Literal ID="NoRecords" runat="server" Text="<%$ Resources: Medianamik_ContentManagement, NoRecordsToDisplay %>" />
			</NoRecordsTemplate>
		</MasterTableView>
		<ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true" >
			<Selecting AllowRowSelect="true"  />
		</ClientSettings>
	</telerik:radgrid>
		
	<br class="clearer" /> 
    <p class="Titre12pxBordure"><asp:Literal runat="server" Text="<%$ Resources:Medianamik_ContentManagement, FormTemplateCaption %>"></asp:Literal></p> 
    <ul id="Legende"> 
        <li class="Picto"> 
            <img src="/Medianamik/images/Icones/Ico_ProprieteObligatoire.png" class="IconeLabel" alt="" />&nbsp;&nbsp;<asp:Literal runat="server" Text="<%$ Resources: Medianamik_ContentManagement,RequiredFieldCaption %>"></asp:Literal>
        </li> 
        <li class="Picto"> 
            <img src="/Medianamik/images/Icones/Ico_ProprieteNeutreLangue.png" class="IconeLabel" alt="" />&nbsp;&nbsp;<asp:Literal runat="server" Text="<%$ Resources: Medianamik_ContentManagement,LanguageNeutralCaption %>"></asp:Literal>
        </li> 
    </ul> 
    <br class="clearer" />
	
</asp:Content>
